﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Data;

namespace WebKpiPage.Data.Condition
{
    public class EventCauseHelper
    {
        /// <summary>
        /// 获取所有事件原因
        /// </summary>
        /// <returns></returns>
        public static Dictionary<short, CauseItem> GetAllCauses()
        {
            if (!bCheck)
            {
                InitAllEventCauseAndDic();
                bCheck = true;
            }
            return new Dictionary<short, CauseItem>(allCauses);
        }
        /// <summary>
        /// 获取事件原因描述与ID的对应关系
        /// </summary>
        public static Dictionary<int, CauseShowInfo> GetAllEventCauseIdDic()
        {
            if (!bCheck)
            {
                InitAllEventCauseAndDic();
                bCheck = true;
            }
            return allCauseEventIdDic;
        }

        private static bool bCheck = false;
        private static Dictionary<short, CauseItem> allCauses = new Dictionary<short, CauseItem>();
        private static Dictionary<int, CauseShowInfo> allCauseEventIdDic = new Dictionary<int, CauseShowInfo>();

        private static void InitAllEventCauseAndDic()
        {
            InitialEventCause();
            for (short shortHeight = 1; shortHeight < 10; shortHeight++)
            {
                CauseItem ci = allCauses[shortHeight];
                foreach (short key in ci.Causes.Keys)
                {
                    int id = Convert.ToInt32((shortHeight << 8) | (ushort)key);
                    CauseShowInfo csi = new CauseShowInfo(ci.Causes[key], id);
                    allCauseEventIdDic[id] = csi;
                }
            }
        }

        private static void InitialEventCause()
        {
            int iNum = 9;
            string strTempName = "RR, RJ, CC, A, CP, RP, SS, ABIS, RLM";
            string[] str1 = strTempName.Split(',');
            List<string> strNameList = new List<string>();
            foreach (string str in str1)
            {
                strNameList.Add(str.Trim());
            }

            string strTempOtherCause = "Normal event-Service option temporarily out of order ---Protocol error, unspecified -Reserved-Reserved-Reserved-for future use";
            string[] str2 = strTempOtherCause.Split('-');
            List<string> strOtherCause = new List<string>();
            foreach (string str in str2)
            {
                strOtherCause.Add(str.Trim());
            }

            string strShortDicTemp1 = "0,1,2,3,4,5,6,8,9,10,13,12,65,95,96,97,98,100,101,111";
            string[] strDic1 = strShortDicTemp1.Split(',');
            List<string> strShort1 = new List<string>(strDic1);
            string strShortDicTemp2 = "2,3,4,5,6,11,12,13,15,17,20,21,22,23,32,33,34,38,95,96,97,98,99,100,101,111";
            string[] strDic2 = strShortDicTemp2.Split(',');
            List<string> strShort2 = new List<string>(strDic2);
            string strShortDicTemp3 = "1,3,6,8,16,17,18,19,21,22,25,26,27,28,29,30,31,34,38,41,42,43,44,47,49,50,55,57,58,63,65,68,69,70,79,81,87,88,91,95,96,97,98,99,100,101,102,111,127";
            string[] strDic3 = strShortDicTemp3.Split(',');
            List<string> strShort3 = new List<string>(strDic3);
            string strShortDicTemp4 = "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,23,32,33,34,35,36,37,38,39,40,41,42,43,48,49,50,51,52,64,65,66,67,80,81,82,83,84,85,86,96,97,98";
            string[] strDic4 = strShortDicTemp4.Split(',');
            List<string> strShort4 = new List<string>(strDic4);
            string strShortDicTemp5 = "22,81,95,96,97,98,99,111";
            string[] strDic5 = strShortDicTemp5.Split(',');
            List<string> strShort5 = new List<string>(strDic5);
            string strShortDicTemp6 = "1,8,10,11,21,22,27,28,29,30,38,41,42,47,50,69,81,95,96,97,98,99,111,127";
            string[] strDic6 = strShortDicTemp6.Split(',');
            List<string> strShort6 = new List<string>(strDic6);
            string strShortDicTemp7 = "1,9,10,11,12,13,16,17,18,19,20,21,27,29,30,34,35,36,37,38,43,71,72,126,127";
            string[] strDic7 = strShortDicTemp7.Split(',');
            List<string> strShort7 = new List<string>(strDic7);
            string strShortDicTemp8 = "0,1,2,3,7,15,32,33,34,35,36,37,38,39,40,41,47,48,63,64,79,80,95,96,97,98,99,100,101,102,103,104,111,127";
            string[] strDic8 = strShortDicTemp8.Split(',');
            List<string> strShort8 = new List<string>(strDic8);
            string strShortDicTemp9 = "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14";
            string[] strDic9 = strShortDicTemp9.Split(',');
            List<string> strShort9 = new List<string>(strDic9);
            List<List<string>> strTheShortList = new List<List<string>>();
            strTheShortList.Add(strShort1);
            strTheShortList.Add(strShort2);
            strTheShortList.Add(strShort3);
            strTheShortList.Add(strShort4);
            strTheShortList.Add(strShort5);
            strTheShortList.Add(strShort6);
            strTheShortList.Add(strShort7);
            strTheShortList.Add(strShort8);
            strTheShortList.Add(strShort9);

            string strShortDicStrTemp1 = "Normal event~Abnormal release, unspecified ~Abnormal release, channel unacceptable ~Abnormal release, timer expired ~Abnormal release, no activity on the radio path~Preemptive release ~UTRAN configuration unknown ~Handover impossible, timing advance out of range ~Channel mode unacceptable ~Frequency not implemented ~Originator or talker leaving group call area ~Lower layer failure ~Call already cleared ~Semantically incorrect message ~Invalid mandatory information ~Message type non-existent or not implemented ~Message type not compatible with protocol state ~Conditional IE error ~No cell allocation available ~Protocol error unspecified";
            string[] strDicStr1 = strShortDicStrTemp1.Split('~');
            List<string> strCauseDicStr1 = new List<string>(strDicStr1);
            string strShortDicStrTemp2 = "IMSI unknown in HLR ~Illegal MS ~IMSI unknown in VLR ~IMEI not accepted ~Illegal ME ~PLMN not allowed ~Location Area not allowed ~Roaming not allowed in this location area ~No Suitable Cells In Location Area ~Network failure ~MAC failure ~Synch failure ~Congestion ~GSM authentication unacceptable ~Service option not supported ~Requested service option not subscribed ~Service option temporarily out of order ~Call cannot be identified ~Semantically incorrect message ~Invalid mandatory information ~Message type non-existent or not implemented ~Message type not compatible with the protocol state ~Information element non-existent or not implemented ~Conditional IE error ~Message not compatible with the protocol state ~Protocol error, unspecified";
            string[] strDicStr2 = strShortDicStrTemp2.Split('~');
            List<string> strCauseDicStr2 = new List<string>(strDicStr2);
            string strShortDicStrTemp3 = "Unassigned (unallocated) number~No route to destination~Channel unacceptable~Operator determined barring~Normal call clearing~User busy~No user responding~User alerting, no answer~Call rejected~Number changed~Pre-emption~Non selected user clearing~Destination out of order~Invalid number format (incomplete number)~Facility rejected~Response to STATUS ENQUIRY~Normal, unspecified~No circuit/channel available~Network out of order~Temporary failure~Switching equipment congestion~Access information discarded~requested circuit/channel not available~Resources unavailable, unspecified~Quality of service unavailable~Requested facility not subscribed~Incoming calls barred within the CUG~Bearer capability not authorized~Bearer capability not presently available~Service or option not available, unspecified~Bearer service not implemented~ACM equal to or greater than ACMmax~Requested facility not implemented~Only restricted digital information bearer capability is available~Service or option not implemented, unspecified~Invalid transaction identifier value~User not member of CUG~Incompatible destination~Invalid transit network selection~Semantically incorrect message~Invalid mandatory information~Message type non-existent or not implemented~Message type not compatible with protocol state~Information element non-existent or not implemented~Conditional IE error~Message not compatible with protocol state~Recovery on timer expiry~Protocol error, unspecified~Interworking, unspecified";
            string[] strDicStr3 = strShortDicStrTemp3.Split('~');
            List<string> strCauseDicStr3 = new List<string>(strDicStr3);
            string strShortDicStrTemp4 = "Radio interface message failure~Radio interface failure~Uplink quality~Uplink strength~Downlink quality~Downlink strength~Distance~O and M intervention~Response to MSC invocation~Call control~Radio interface failure, reversion to old channel~Handover successful~Better Cell~Directed Retry~Joined group call channel~Traffic~Reduce load in serving cell~Traffic load in target cell higher than in source cell~Relocation triggered~Requested option not authorised~Alternative channel configuration requested ~Call Identifier already allocated~INTERNAL HANDOVER ENQUIRY reject~Equipment failure~No radio resource available~Requested terrestrial resource unavailable~CCCH overload~Processor overload~BSS not equipped~MS not equipped~Invalid cell~Traffic Load~Preemption~DTM Handover - SGSN Failure~DTM Handover - PS Allocation failure~Requested transcoding/rate adaption unavailable~Circuit pool mismatch~Switch circuit pool~Requested speech version unavailable~LSA not allowed~Ciphering algorithm not supported~GERAN Iu-mode failure~Incoming Relocation Not Supported Due To PUESBINE Feature~Access Restricted Due to Shared Networks~Terrestrial circuit already allocated~Invalid message contents~Information element or field missing~Incorrect value~Unknown Message type~Unknown Information Element~DTM Handover - Invalid PS Indication~Protocol Error between BSS and MSC~VGCS/VBS call non existent~DTM Handover - Timer Expiry";
            string[] strDicStr4 = strShortDicStrTemp4.Split('~');
            List<string> strCauseDicStr4 = new List<string>(strDicStr4);
            string strShortDicStrTemp5 = "Congestion ~Invalid Transaction Identifier value ~Semantically incorrect message ~Invalid mandatory information ~Message type non-existent or not implemented ~Message not compatible with the short message protocol state ~Information element non-existent or not implemented ~Protocol error, unspecified";
            string[] strDicStr5 = strShortDicStrTemp5.Split('~');
            List<string> strCauseDicStr5 = new List<string>(strDicStr5);
            string strShortDicStrTemp6 = "Unassigned (unallocated) number~Operator determined barring~Call barred~Reserved~Short message transfer rejected~Memory capacity exceeded~Destination out of order~Unidentified subscriber~Facility rejected~Unknown subscriber~Network out of order~Temporary failure~Congestion~Resources unavailable, unspecified~Requested facility not subscribed~Requested facility not implemented~Invalid short message transfer reference value~Semantically incorrect message~Invalid mandatory information~Message type non-existent or not implemented~Message not compatible with short message protocol state~Information element non-existent or not implemented~Protocol error, unspecified~Interworking, unspecified";
            string[] strDicStr6 = strShortDicStrTemp6.Split('~');
            List<string> strCauseDicStr6 = new List<string>(strDicStr6);
            string strShortDicStrTemp7 = "UnknownSubscriber~IllegalSubscriber~BearerServiceNotProvisioned~TeleserviceNotProvisioned~IllegalEquipment~CallBarred~IllegalSS-Operation~SS-ErrorStatus~SS-NotAvailable~SS-SubscriptionViolation~SS-Incompatibility~FacilityNotSupported~AbsentSubscriber~ShortTermDenial~LongTermDenial~SystemFailure~DataMissing~UnexpectedDataValue~PW-RegistrationFailure~NegativePW-Check~NumberOfPW-AttemptsViolation~UnknownAlphabet~USSD-Busy~MaxNumberOfMPTY-ParticipantsExceeded~ResourcesNotAvailable";
            string[] strDicStr7 = strShortDicStrTemp7.Split('~');
            List<string> strCauseDicStr7 = new List<string>(strDicStr7);
            string strShortDicStrTemp8 = "radio interface failure~radio link failure~handover access failure~talker access failure~O&M intervention~normal event, unspecified~equipment failure~radio resource not available~terrestrial channel failure~CCCH overload~ACCH overload~processor overload~reserved for international use~BTS not equipped~remote transcoder failure~notification overflow~resource not available, unspecified~requested transcoding/rate adaption not available~service or option not available, unspecified~encryption algorithm not implemented~service or option not implemented, unspecified~radio channel already activated/allocated~invalid message, unspecified~message discriminator error~message type error~message sequence error~general information element error~mandatory information element error~optional information element error~information element non-existent~information element length error~invalid information element contents~protocol error, unspecified~interworking, unspecified";
            string[] strDicStr8 = strShortDicStrTemp8.Split('~');
            List<string> strCauseDicStr8 = new List<string>(strDicStr8);
            string strShortDicStrTemp9 = "reserved~timer T200 expired (N200+1) times~re-establishment request~unsolicited UA response~unsolicited DM response~unsolicated DM response, multiple frame established state~unsolicited supervisory response~sequence error~U-frame with incorrect parameters~S-frame with incorrect parameters~I-frame with incorrect use of M bit~I-frame with incorrect length~frame not implemented~SABM command, multiple frame established state~SABM frame with information not allowed in this state";
            string[] strDicStr9 = strShortDicStrTemp9.Split('~');
            List<string> strCauseDicStr9 = new List<string>(strDicStr9);
            List<List<string>> strTheStringList = new List<List<string>>();
            strTheStringList.Add(strCauseDicStr1);
            strTheStringList.Add(strCauseDicStr2);
            strTheStringList.Add(strCauseDicStr3);
            strTheStringList.Add(strCauseDicStr4);
            strTheStringList.Add(strCauseDicStr5);
            strTheStringList.Add(strCauseDicStr6);
            strTheStringList.Add(strCauseDicStr7);
            strTheStringList.Add(strCauseDicStr8);
            strTheStringList.Add(strCauseDicStr9);

            for (int i = 0; i < iNum; i++)
            {
                Dictionary<short, string> dt = new Dictionary<short, string>();
                List<string> shortTempList = strTheShortList[i];
                List<string> stringTempList = strTheStringList[i];
                for (int j = 0; j < shortTempList.Count; j++)
                {
                    short sh = Convert.ToInt16(shortTempList[j]);
                    string str = stringTempList[j];
                    dt[sh] = str;
                }
                short iShort = Convert.ToInt16(i + 1);
                CauseItem ci = new CauseItem(strNameList[i], iShort, dt, strOtherCause[i]);
                allCauses.Add(ci.CauseType, ci);
            }
        }

        

        public static string GetCauseDesBy(short type, short cause)
        {
            if (!bCheck)
            {
                InitialEventCause();
                bCheck = true;
            }
            string causeStr = "";
            if (type == 3)
            {
                if (allCauses[3].Causes.ContainsKey(cause))
                {
                    causeStr = allCauses[3].Causes[cause];
                }
                else if (cause < 31)
                    causeStr = "Treat as Normal, unspecified";
                else if (cause < 47 && cause >= 32)
                    causeStr = "Treat as Resources unavailable, unspecified";
                else if (cause < 79 && cause >= 64)
                    causeStr = "Treat as Service or option not implemented, unspecified";
                else if (cause < 95 && cause >= 80)
                    causeStr = "Treat as Semantically incorrect message";
                else if (cause < 111 && cause >= 96)
                    causeStr = "Treat as Protocol error, unspecified";
                else if (cause <= 127 && cause >= 112)
                    causeStr = "Treat as Interworking, unspecified";
                else
                    causeStr = "other" ;
                causeStr = "(" + allCauses[type].Name + ")" + causeStr;
            }
            else if (type == 4)
            {
                if (allCauses[4].Causes.ContainsKey(cause))
                {
                    causeStr = allCauses[4].Causes[cause];
                }
                else if (cause >= 0x17 && cause <= 0x18)
                    causeStr = "Reserved for international use";
                else if (cause >= 0x18 && cause <= 0x1f)
                    causeStr = "Reserved for national use";
                else if (cause >= 0x2c && cause <= 0x2f)
                    causeStr = "Reserved for international use";
                else if (cause >= 0x35 && cause <= 0x3f)
                    causeStr = "Reserved for international use";
                else if (cause >= 0x44 && cause <= 0x47)
                    causeStr = "Reserved for international use";
                else if (cause >= 0x48 && cause <= 0x4f)
                    causeStr = "Reserved for national use";
                else if (cause >= 0x58 && cause <= 0x4f)
                    causeStr = "Reserved for national use";
                else if (cause >= 0x63 && cause <= 0x67)
                    causeStr = "Reserved for international use";
                else if (cause >= 0x68 && cause <= 0x6f)
                    causeStr = "Reserved for national use";
                else if (cause >= 0x70 && cause <= 0x77)
                    causeStr = "Reserved for international use";
                else if (cause >= 0x78 && cause <= 0x7f)
                    causeStr = "Reserved for national use";
                causeStr = "other" ;
                causeStr = "(" + allCauses[type].Name + ")" + causeStr;
            }
            else if (allCauses.ContainsKey(type))
            {
                if (allCauses[type].Causes.ContainsKey(cause))
                {
                    causeStr = allCauses[type].Causes[cause];
                }
                else
                {
                    causeStr = allCauses[type].OtherCause;
                }
                causeStr = "(" + allCauses[type].Name + ")" + causeStr;
            }
            else
                causeStr = "未知类型" + type;
            return causeStr;
        }

        public static string GetAnaCauseDesBy(int type)
        {
            switch (type)
            {
                case 1:
                    return "上下行链路平衡_上大于下";
                case 2:
                    return "上下行链路平衡_下大于上";
                case 3:
                    return "下行强信号弱质量";
                case 4:
                    return "上行强信号弱质量";
                case 5:
                    return "下行弱覆盖";
                case 6:
                    return "邻区参数设置";
                case 7:
                    return "上下行质差";
                case 8:
                    return "上行质差";
                case 9:
                    return "下行质差";
                case 10:
                    return "越区覆盖";
                default:
                    return "其它";
            }
        }
    }
}

#region 描述
//        private static Dictionary<short, CauseItem> allCauses = new Dictionary<short, CauseItem>()
//          {
//{1,new CauseItem("RR",1,new Dictionary<short, string>() { 
//{0,"Normal event"},
//{1,"Abnormal release, unspecified "},
//{2,"Abnormal release, channel unacceptable "},
//{3,"Abnormal release, timer expired "},
//{4,"Abnormal release, no activity on the radio path "},
//{5,"Preemptive release "},
//{6,"UTRAN configuration unknown "},
//{8,"Handover impossible, timing advance out of range "},
//{9,"Channel mode unacceptable "},
//{10,"Frequency not implemented "},
//{13,"Originator or talker leaving group call area "},
//{12,"Lower layer failure "},
//{65,"Call already cleared "},
//{95,"Semantically incorrect message "},
//{96,"Invalid mandatory information "},
//{97,"Message type non-existent or not implemented "},
//{98,"Message type not compatible with protocol state "},
//{100,"Conditional IE error "},
//{101,"No cell allocation available "},
//{111,"Protocol error unspecified "}},"Normal event ")}
//,
//{2,new CauseItem("RJ",2,new Dictionary<short, string>() { 
//{2,"IMSI unknown in HLR "},
//{3,"Illegal MS "},
//{4,"IMSI unknown in VLR "},
//{5,"IMEI not accepted "},
//{6,"Illegal ME "},
//{11,"PLMN not allowed "},
//{12,"Location Area not allowed "},
//{13,"Roaming not allowed in this location area "},
//{15,"No Suitable Cells In Location Area "},
//{17,"Network failure "},
//{20,"MAC failure "},
//{21,"Synch failure "},
//{22,"Congestion "},
//{23,"GSM authentication unacceptable "},
//{32,"Service option not supported "},
//{33,"Requested service option not subscribed "},
//{34,"Service option temporarily out of order "},
//{38,"Call cannot be identified "},
//{95,"Semantically incorrect message "},
//{96,"Invalid mandatory information "},
//{97,"Message type non-existent or not implemented "},
//{98,"Message type not compatible with the protocol state "},
//{99,"Information element non-existent or not implemented "},
//{100,"Conditional IE error "},
//{101,"Message not compatible with the protocol state "},
//{111,"Protocol error, unspecified "}},"Service option temporarily out of order ")}
//,
//{3,new CauseItem("CC",3,new Dictionary<short, string>() { 
//{1,"Unassigned (unallocated) number"},
//{3,"No route to destination"},
//{6,"Channel unacceptable"},
//{8,"Operator determined barring"},
//{16,"Normal call clearing"},
//{17,"User busy"},
//{18,"No user responding"},
//{19,"User alerting, no answer"},
//{21,"Call rejected"},
//{22,"Number changed"},
//{25,"Pre-emption"},
//{26,"Non selected user clearing"},
//{27,"Destination out of order"},
//{28,"Invalid number format (incomplete number)"},
//{29,"Facility rejected"},
//{30,"Response to STATUS ENQUIRY"},
//{31,"Normal, unspecified"},
//{34,"No circuit/channel available"},
//{38,"Network out of order"},
//{41,"Temporary failure"},
//{42,"Switching equipment congestion"},
//{43,"Access information discarded"},
//{44,"requested circuit/channel not available"},
//{47,"Resources unavailable, unspecified"},
//{49,"Quality of service unavailable"},
//{50,"Requested facility not subscribed"},
//{55,"Incoming calls barred within the CUG"},
//{57,"Bearer capability not authorized"},
//{58,"Bearer capability not presently available"},
//{63,"Service or option not available, unspecified"},
//{65,"Bearer service not implemented"},
//{68,"ACM equal to or greater than ACMmax"},
//{69,"Requested facility not implemented"},
//{70,"Only restricted digital information bearer capability is available"},
//{79,"Service or option not implemented, unspecified"},
//{81,"Invalid transaction identifier value"},
//{87,"User not member of CUG"},
//{88,"Incompatible destination"},
//{91,"Invalid transit network selection"},
//{95,"Semantically incorrect message"},
//{96,"Invalid mandatory information"},
//{97,"Message type non-existent or not implemented"},
//{98,"Message type not compatible with protocol state"},
//{99,"Information element non-existent or not implemented"},
//{100,"Conditional IE error"},
//{101,"Message not compatible with protocol state"},
//{102,"Recovery on timer expiry"},
//{111,"Protocol error, unspecified"},
//{127,"Interworking, unspecified"}},"")}
//,
//{4,new CauseItem("A",4,new Dictionary<short,string>(){
//{0x00,"Radio interface message failure"},
//{0x01,"Radio interface failure"},
//{0x02,"Uplink quality"},
//{0x03,"Uplink strength"},
//{0x04,"Downlink quality"},
//{0x05,"Downlink strength"},
//{0x06,"Distance"},
//{0x07,"O and M intervention"},
//{0x08,"Response to MSC invocation"},
//{0x09,"Call control"},
//{0x0a,"Radio interface failure, reversion to old channel"},
//{0x0b,"Handover successful"},
//{0x0c,"Better Cell"},
//{0x0d,"Directed Retry"},
//{0x0e,"Joined group call channel"},
//{0x0f,"Traffic"},
//{0x10,"Reduce load in serving cell"},
//{0x11,"Traffic load in target cell higher than in source cell"},
//{0x12,"Relocation triggered"},
//{0x14,"Requested option not authorised"},
//{0x15,"Alternative channel configuration requested "},
//{0x16,"Call Identifier already allocated"},
//{0x17,"INTERNAL HANDOVER ENQUIRY reject"},
//{0x20,"Equipment failure"},
//{0x21,"No radio resource available"},
//{0x22,"Requested terrestrial resource unavailable"},
//{0x23,"CCCH overload"},
//{0x24,"Processor overload"},
//{0x25,"BSS not equipped"},
//{0x26,"MS not equipped"},
//{0x27,"Invalid cell"},
//{0x28,"Traffic Load"},
//{0x29,"Preemption"},
//{0x2a,"DTM Handover - SGSN Failure"},
//{0x2b,"DTM Handover - PS Allocation failure"},
//{0x30,"Requested transcoding/rate adaption unavailable"},
//{0x31,"Circuit pool mismatch"},
//{0x32,"Switch circuit pool"},
//{0x33,"Requested speech version unavailable"},
//{0x34,"LSA not allowed"},
//{0x40,"Ciphering algorithm not supported"},
//{0x41,"GERAN Iu-mode failure"},
//{0x42,"Incoming Relocation Not Supported Due To PUESBINE Feature"},
//{0x43,"Access Restricted Due to Shared Networks"},
//{0x50,"Terrestrial circuit already allocated"},
//{0x51,"Invalid message contents"},
//{0x52,"Information element or field missing"},
//{0x53,"Incorrect value"},
//{0x54,"Unknown Message type"},
//{0x55,"Unknown Information Element"},
//{0x56,"DTM Handover - Invalid PS Indication"},
//{0x60,"Protocol Error between BSS and MSC"},
//{0x61,"VGCS/VBS call non existent"},
//{0x62,"DTM Handover - Timer Expiry"}},"")}
//,
//{5,new CauseItem("CP",5,new Dictionary<short, string>() { 
//{22,"Congestion "},
//{81,"Invalid Transaction Identifier value "},
//{95,"Semantically incorrect message "},
//{96,"Invalid mandatory information "},
//{97,"Message type non-existent or not implemented "},
//{98,"Message not compatible with the short message protocol state "},
//{99,"Information element non-existent or not implemented "},
//{111,"Protocol error, unspecified "}},"Protocol error, unspecified ")}
//,
//{6,new CauseItem("RP",6,new Dictionary<short, string>() { 
//{1,"Unassigned (unallocated) number"},
//{8,"Operator determined barring"},
//{10,"Call barred"},
//{11,"Reserved"},
//{21,"Short message transfer rejected"},
//{22,"Memory capacity exceeded"},
//{27,"Destination out of order"},
//{28,"Unidentified subscriber"},
//{29,"Facility rejected"},
//{30,"Unknown subscriber"},
//{38,"Network out of order"},
//{41,"Temporary failure"},
//{42,"Congestion"},
//{47,"Resources unavailable, unspecified"},
//{50,"Requested facility not subscribed"},
//{69,"Requested facility not implemented"},
//{81,"Invalid short message transfer reference value"},
//{95,"Semantically incorrect message"},
//{96,"Invalid mandatory information"},
//{97,"Message type non-existent or not implemented"},
//{98,"Message not compatible with short message protocol state"},
//{99,"Information element non-existent or not implemented"},
//{111,"Protocol error, unspecified"},
//{127,"Interworking, unspecified"}},"Reserved")}     
//,
//{7,new CauseItem("SS",7,new Dictionary<short, string>() { 
//{1,"UnknownSubscriber"},			
//{9,"IllegalSubscriber"},			
//{10,"BearerServiceNotProvisioned"},			
//{11,"TeleserviceNotProvisioned"},			
//{12,"IllegalEquipment"},			
//{13,"CallBarred"},			
//{16,"IllegalSS-Operation"},			
//{17,"SS-ErrorStatus"},			
//{18,"SS-NotAvailable"},			
//{19,"SS-SubscriptionViolation"},			
//{20,"SS-Incompatibility"},			
//{21,"FacilityNotSupported"},			
//{27,"AbsentSubscriber"},			
//{29,"ShortTermDenial"},			
//{30,"LongTermDenial"},			
//{34,"SystemFailure"},			
//{35,"DataMissing"},			
//{36,"UnexpectedDataValue"},			
//{37,"PW-RegistrationFailure"},			
//{38,"NegativePW-Check"},			
//{43,"NumberOfPW-AttemptsViolation"},			
//{71,"UnknownAlphabet"},			
//{72,"USSD-Busy"},			
//{126,"MaxNumberOfMPTY-ParticipantsExceeded"},			
//{127,"ResourcesNotAvailable"},			
//},"Reserved")}
//,
//{8,new CauseItem("ABIS",8,new Dictionary<short, string>() { 
//{0,"radio interface failure"},	
//{1,"radio link failure"},	
//{2,"handover access failure"},	
//{3,"talker access failure"},	
//{7,"O&M intervention"},	
//{15,"normal event, unspecified"},	
//{32,"equipment failure"},	
//{33,"radio resource not available"},	
//{34,"terrestrial channel failure"},	
//{35,"CCCH overload"},	
//{36,"ACCH overload"},	
//{37,"processor overload"},	
//{38,"reserved for international use"},	
//{39,"BTS not equipped"},	
//{40,"remote transcoder failure"},	
//{41,"notification overflow"},	
//{47,"resource not available, unspecified"},	
//{48,"requested transcoding/rate adaption not available"},	
//{63,"service or option not available, unspecified"},	
//{64,"encryption algorithm not implemented"},	
//{79,"service or option not implemented, unspecified"},	
//{80,"radio channel already activated/allocated"},	
//{95,"invalid message, unspecified"},	
//{96,"message discriminator error"},	
//{97,"message type error"},	
//{98,"message sequence error"},	
//{99,"general information element error"},	
//{100,"mandatory information element error"},	
//{101,"optional information element error"},	
//{102,"information element non-existent"},	
//{103,"information element length error"},	
//{104,"invalid information element contents"},	
//{111,"protocol error, unspecified"},	
//{127,"interworking, unspecified"},	
//},"Reserved")}
//,
//{9,new CauseItem("RLM",9,new Dictionary<short, string>() { 
//{0,"reserved"},		
//{1,"timer T200 expired (N200+1) times"},		
//{2,"re-establishment request"},		
//{3,"unsolicited UA response"},		
//{4,"unsolicited DM response"},		
//{5,"unsolicated DM response, multiple frame established state"},		
//{6,"unsolicited supervisory response"},		
//{7,"sequence error"},		
//{8,"U-frame with incorrect parameters"},		
//{9,"S-frame with incorrect parameters"},		
//{10,"I-frame with incorrect use of M bit"},		
//{11,"I-frame with incorrect length"},		
//{12,"frame not implemented"},		
//{13,"SABM command, multiple frame established state"},		
//{14,"SABM frame with information not allowed in this state"},
//},"for future use")}
//          };
#endregion 描述